package eight.test_8_10;

import java.util.HashSet;
import java.util.Set;

public class TestMain3 {
    private static int mex(int[] arr) {
        Set<Integer> seen = new HashSet<>();
        for (int num : arr) {
            seen.add(num);
        }
        int mex = 0;
        while (seen.contains(mex)) {
            mex++;
        }
        return mex;
    }
}
